package com.yz.house.ui.adaper;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yz.house.R;
import com.yz.house.model.ContentBean;
import com.yz.house.model.HouseHelpBean;

import java.util.List;

/**
 * Demo
 *
 * @author zhangyf
 * @date 2018/4/12 0012.
 */
public class ContentListAdapter extends BaseQuickAdapter<ContentBean,BaseViewHolder>{

    public ContentListAdapter(@Nullable List<ContentBean> data) {
        super(R.layout.item_content,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ContentBean item) {
        helper.setText(R.id.tv_name,item.getName());
        helper.setText(R.id.tv_time,item.getTime());
        helper.setText(R.id.tv_content,item.getTitle());
        Glide.with(mContext).load(item.getAvatar()).into((ImageView) helper.getView(R.id.iv_avatar));
        Glide.with(mContext).load(item.getCover()).into((ImageView) helper.getView(R.id.iv_pic));
    }
}
